import requests
from bs4 import BeautifulSoup

url = "http://www.zongheng.com/rank/details.html?rt=1&d=1"

reponse = requests.get(url)
# print(reponse.status_code)
# print(reponse.text)

soup = BeautifulSoup(reponse.text,"html.parser")
# print(soup.div)
res = soup.find_all(class_="rank_d_b_name")

for i in res:
    # i的类型为soup
    # 获取标签中的值采用string对象
    print(i.a.string)

number = soup.find_all(class_="rank_d_b_rank")
    # print(number)
    # print(len(number))
for j in number:
        #j的类型是BeautifulSoup
        #获取标签中的值采用string对象
        # print(j.div.string) #获取排名
        # 吧把tag中的子对象换成list
    print(j.contents[3].contents[0])



